package com.ssm.service.impl;

import com.ssm.mapper.BuildMapper;
import com.ssm.pojo.Build;
import com.ssm.service.BuildService;
import com.ssm.vo.BuildVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BuildServiceImpl implements BuildService {
    @Autowired
    private BuildMapper buildMapper;
    //
    @Override
    public List<Build> findAllBuildNumber() {
        return buildMapper.findAllBuildNumber();
    }
    //添加楼栋号
    @Override
    public int addBuild(Build build) {
        return buildMapper.addBuild(build);
    }
    //修改楼层号
    @Override
    public int updateBuildNumber(Build build) {
        return buildMapper.updateBuildNumber(build);
    }
    //通过buildId删除
    @Override
    public int deleteBuildById(int buildId) {
        return buildMapper.deleteBuildById(buildId);
    }
    //批量删除
    @Override
    public int deletebuilds(int[] res) {
        return buildMapper.deleteBuilds(res);
    }
    //通过buildNumber查询
    @Override
    public List<Build> selectByBuildNumber(Integer buildNumber) {
        return buildMapper.selectByBuildNumber(buildNumber);
    }
    //通过buildId查找
    @Override
    public List<Build> selectByBuildId(Integer buildId) {
        return buildMapper.selectByBuildId(buildId);
    }
    //通过楼层号和楼层Id查找
    @Override
    public List<Build> selectByBuildIdAndBuildNumber(Integer buildId, Integer buildNumber) {
        return buildMapper.selectByBuildIdAndBuildNumber(buildId,buildNumber);
    }
    //查询所有
    @Override
    public List<Build> queryAll() {
        return buildMapper.queryAll();
    }

}
